
$(function() {	
	$("input[id='emp']:visible").autocomplete(Test.emp);
	
	_ck_default("input[id='emp']:visible", "input[id^='emp_t']:visible");
	
	_change("input[id='place']:visible", "select[id^='place_t']:visible");
	
	$('#date').datepicker(_date1_option);
	
	$('#amount4').change(function() {
		var s = $(this).val();
		_amount(s);
	});
});

function _amount(s) {
	
	var amount5 = $('#amount5').val();
	
	var amount4 = parseFloat(s);
	amount5 = parseFloat(amount5);
	
	if (amount4 > amount5) {
		$('#amount4').val(amount5);
		alert("本次入库物品的数量不能大于未入库的数量，请重新输入！");
		return false;
	}
	
	var amount = $('#amount').val();
	var amount2 = $('#amount2').val();
	
	// alert(amount3);
	// alert(amount4);
	// alert(amount);
	
	var a = fxmul(amount4, amount2) / amount;
	
	$('#amount3').val(a);
	
}